package com.wicket.okrpbff.biz.service.impl;

import com.wicket.okrframework.integration.FwBasePasswordClient;
import com.wicket.okrframework.integration.dto.UpdateChangePasswordReqDto;
import com.wicket.okrframework.integration.dto.UpdateChangePasswordRespDto;
import com.wicket.okrpbff.biz.service.PasswordService;
import com.wicket.okrpbff.biz.service.dto.req.BffUpdateChangePasswordReqDto;
import com.wicket.okrpbff.biz.service.dto.res.BffUpdateChangePasswordRespDto;
import com.wicket.okrpbff.common.util.RedisUtil;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import com.wicket.okrpbff.common.exception.Assert;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class PasswordServiceImpl implements PasswordService {

    @Resource
    FwBasePasswordClient fwBasePasswordClient;
    @Resource
    private RedisUtil redisUtil;

    /**
   * B1-2修改密码（管理）[418]
   * gen by moon at 8/10/2022, 3:39:41 AM
   */
    @Trace(operationName = "B1-2修改密码（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffUpdateChangePasswordRespDto updateChangePassword(BffUpdateChangePasswordReqDto reqDto){
      
       
       //步骤0: D1-2修改密码 - updateChangePassword
     UpdateChangePasswordRespDto updateChangePasswordRespDto = null;
    UpdateChangePasswordReqDto updateChangePasswordReqDto=new UpdateChangePasswordReqDto();
  if(reqDto!=null){
      updateChangePasswordReqDto.setUserId(reqDto.getUserId());//sourceId:25175_1
updateChangePasswordReqDto.setPassword(reqDto.getPassword());//sourceId:54406_1
    }
  
    /*D1-2修改密码[1158]   */
    Assert.isNull(updateChangePasswordReqDto.getUserId(),"B1-2修改密码（管理）-D1-2修改密码-个人账号不能为空",false);
Assert.isNull(updateChangePasswordReqDto.getPassword(),"B1-2修改密码（管理）-D1-2修改密码-密码不能为空",false);
      updateChangePasswordRespDto = fwBasePasswordClient.updateChangePassword(updateChangePasswordReqDto).getData();
      
      
    
BffUpdateChangePasswordRespDto retData = new BffUpdateChangePasswordRespDto();
  
  

  
  
return retData;
  }
    //
}
